import {
  getSeller,
  getGoods
} from 'api';

export default {
  async getSellerAsyn({
    commit,
    state
  }, payload) {
    const {
      sellerID
    } = payload;
    const data = await getSeller({
      'id': sellerID
    });
    commit('getSeller', {
      ...{
        'id': Number(sellerID)
      },
      ...data
    });
  },
  async getGoodsAsyn({
    commit
  }, payload) {
    const {
      sellerID
    } = payload;
    const data = await getGoods({
      'id': sellerID
    });
    commit('getGoods', {
      ...{
        'id': Number(sellerID)
      },
      ...data
    });
  }
};
